package com.ylbh.modules.statistics.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ylbh.common.pojo.statistics.UserListExcel;
import com.ylbh.common.pojo.statistics.dto.OperationStatisticsDTO;
import com.ylbh.common.pojo.statistics.vo.MembershipVO;
import com.ylbh.common.pojo.statistics.vo.UserListVO;
import com.ylbh.modules.business.entity.ShoppingUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 运营统计
 * @author czx
 */
@Mapper
@Repository
public interface OperationStatisticsMapper extends BaseMapper<ShoppingUser> {

    /**
     * 返回各用户类型的数量
     * @param userType
     * @return
     */
    int selectUserCount(@Param(value = "operationStatisticsDTO") OperationStatisticsDTO operationStatisticsDTO);

    /**
     * 类型下的所有用户
     * @param operationStatisticsDTO
     * @param page
     * @return
     */
    List<UserListVO> selectUser(@Param(value = "operationStatisticsDTO") OperationStatisticsDTO operationStatisticsDTO, Page page);

    /**
     * 运营统计
     * @param operationStatisticsDTO
     * @return
     */
    List<MembershipVO> selectMembership(@Param(value = "operationStatisticsDTO") OperationStatisticsDTO operationStatisticsDTO);

    /**
     * 运营统计下的各类型下的下级
     * @param operationStatisticsDTO
     * @param page
     * @return
     */
    List<UserListVO> selectMembershipLower(@Param(value = "operationStatisticsDTO")OperationStatisticsDTO operationStatisticsDTO, Page<Object> page);

    /**
     * 运营统计导出
     * @param keywords
     * @return
     */
    List<UserListExcel> exportMembershipLowerExcel(@Param(value = "keywords") String keywords);
}
